<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <base href="<?php echo base_url(); ?>"/>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Thông tin khách sạn</title>
        
        <link rel="stylesheet" type="text/css" media="all" href="resources/home/css/reset.css" />
        <link rel="stylesheet" type="text/css" media="all" href="resources/home/css/960.css" />
        <link rel="stylesheet" type="text/css" media="all" href="resources/home/css/style.css" />
        <link rel="stylesheet" type="text/css" media="all" href="resources/home/css/search_style.css" />
        <link rel="stylesheet" href="resources/home/css/screen_ivivu.css" type="text/css"/>
        <link rel="stylesheet" type="text/css" href="resources/home/css/superfish.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="resources/home/css/cupertino/jquery-ui-1.9.2.custom.min.css" />
        <link rel="stylesheet" type="text/css" href="resources/home/css/compare.css" />        
        
		<script type="text/javascript" src="resources/home/scripts/jquery.datePicker.js"></script>         
		<script type="text/javascript" src="resources/home/scripts/jquery.date.js"></script>
        <script type="text/javascript" src="resources/home/scripts/jquery-1.8.3.js"></script> 
		<script type="text/javascript" src="resources/home/scripts/jquery-ui-1.9.2.custom.min.js"></script>         

        <!--[if IE]>
        <link rel="stylesheet" media="all" type="text/css" href="css/pro_dropline_ie.css" />
        <![endif]-->
        

        <!-- End menu css and js files here -->
        <!-- Begin featured slider css & js files -->
        <!-- End featured slider css & js files -->
        <!--[if IE 6]>
        <script type='text/javascript' src='js/dd_belated_png.js'></script>
        <script>DD_belatedPNG.fix('.pngfix');</script>
        <![endif]-->


        <!--
        <script>
          $(function() {
              $("#datepicker").datepicker();
          });
        </script>

        -->

    </head>
    <body onload="load_()">
        <div class="subbg">
            <div class="subheader">  <!--start:header -->
                <div class="container_16">
                    <!--start:header container -->
                    <!--start:logo -->
                    <div class="grid_5">
                        <a href="index.php/home"><img src="resources/home/images/logo.png" alt="DesignPlus" class="pngfix logo"/></a>
                    </div>
                    <!--end:logo -->
                    <div class="grid_11">
                        <!--start:menu grid -->
                        <div class="top-menu pngfix">
                            <!--start:menu top-menu -->
                            <ul class="sf-menu">
                                <!--start:sf-menu -->
                                <li> <a href="<?php echo site_url('home'); ?>">Trang chủ</a> </li>
                                <li> <a href="<?php echo site_url('GioiThieu'); ?>">Giới thiệu</a> </li>
                                <li> <a href="<?php echo site_url('khuyenmai'); ?>">Khuyến mãi</a></li>
                                <li> <a href="<?php echo site_url('nhacungcap'); ?>">Đối tác</a> </li>
                                <li> <a href="<?php echo site_url('LienHe'); ?>">Liên hệ - Hỗ trợ</a> </li>
                            </ul>
                            <!--end:sf-menu -->
                            <span class="rightcorner pngfix"></span> </div>
                        <!--end:menu top-menu -->
                    </div>
                    <!--end:menu grid -->
                    <div class="clear">&nbsp;</div>
                    <div class="grid_16">
                        <!--start:featured slider grid -->
                        <div id="listsosanh">
                            <?php $this->load->view('home/danhsach_sosanh_view'); ?>
                        </div>
                        <!--Begin Search form-->
                        <div class="searchform">
                            <div class="header_02">
                                <div class="moduletable">
                                    <div class="layout_search_page"><div id="from_search_booking" class='vi'>

                                            <div id="archor_search" style="position: absolute; top: 10px;"></div>
                                            <div class="wrap"></div>

                                            <?php
												  if($select_country)
												  {
													  $selected_country = $select_country;
													  
													  $option_country = "<option value=''>Quốc gia</option>";
																					  
													  foreach($country as $row)
													  {
														  $q = $row->QuocGia;
														  if($select_country == $q)
															  $option_country = $option_country . "<option value='$q' selected='selected'>$q</option>";
														  else
															  $option_country = $option_country . "<option value='$q'>$q</option>";
													  }
												  }
												  else
												  {
  													  $selected_country = "";
													  
													  $option_country = "<option value='' selected='selected'>Quốc gia</option>";
																					  
													  foreach($country as $row)
													  {
														  $q = $row->QuocGia;
														  $option_country = $option_country . "<option value='$q'>$q</option>";
													  }													  
												  }
												  
												  if($select_city)
												  {
													  $selected_city = $select_city;
													  
													  $option_city = "<option value=''>Thành phố</option>";
																					  
													  foreach($city as $row)
													  {
														  $q = $row->Tinh_ThanhPho;
														  if($select_city == $q)
															  $option_city = $option_city . "<option value='$q' selected='selected'>$q</option>";
														  else
															  $option_city = $option_city . "<option value='$q'>$q</option>";
													  }
												  }
												  else
												  {
													  $selected_city = "";													  
													  
													  $option_city = "<option value='' selected='selected'>Thành phố</option>";
												  }
												  
												  if($region && $select_region)
												  {
													  $selected_region = $select_region;
													  
													  $option_region = "<option value=''>Khu vực</option>";
																					  
													  foreach($region as $row)
													  {
														  $q = $row->Quan;
														  if($select_region == $q)
															  $option_region = $option_region . "<option value='$q' selected='selected'>$q</option>";
														  else
															  $option_region = $option_region . "<option value='$q'>$q</option>";
													  }
												  }
												  else
												  	  if($region && !$select_region)
													  {
		    											  $selected_region = "";
													  
														  $option_region = "<option value='' selected='selected'>Khu vực</option>";
																					  
													  	  foreach($region as $row)
													      {
														  	  $q = $row->Quan;
														  	  $option_region = $option_region . "<option value='$q'>$q</option>";
														  }													  
													  }
													  else
														   if(!$region)
						   								   {
															  $selected_region = "";													  
													  
															  $option_region = "<option value='' selected='selected'>Khu vực</option>";
														   }
												  
											  	  if($select_date)
												  		$display_select_date = date('d/m/Y',strtotime($select_date));
											?>
                                            <div class="header02_right">
                                              <div class="header_search_01"> 
                                                  <div id="txtcommit" class="base_color"> Các khách sạn Việt Nam và Quốc tế</div> 
                                                  <div id="quick_search" onclick="displayButton(1)">
                                                      <form action="<?php echo site_url('searchKhachSan/search_Hotel') ?>" id="form_search_name" name="form_search_name" method="post" >
                                                          <input type="text" size="50" maxlength="80" id="searchname" name="searchname" value="<?php echo $select_hotel; ?>" onfocus='clearText(this)' onblur='clearText(this)' class="B_input" />
                                                          <input type="hidden" id="tp" name="tp" value="<?php echo $selected_city; ?>"/>
                                                          <input type="hidden" id="qg" name="qg" value="<?php echo $selected_country; ?>"/>
                                                          <input type="hidden" id="kv" name="kv" value="<?php echo $selected_region; ?>"/>    
                                                      <div id="search_button_1" class="button1" style="display:inline; width:65px; margin-left:5px; padding-left:5px; padding-right:5px; padding-top:5px; padding-bottom:5px;">Tìm kiếm</div>
                                                      </div>
                                                  </div>
                                                  <div class="header_search_02">
                                                      <div id="destination_search" onclick="displayButton(2)">
                                                          <select id='id_des_country' class="option_search" name="id_des_country" onchange="getCityByCountry();" style="width:120px">
                                                              
                                                              <?php 
                                                                  echo $option_country;
                                                              ?>
                                                          </select>
                                            
                                                          <select id='id_des_city' class="option_search" name="id_des_city" onchange="getRegionByCity(); displayButton(2);" style="width:120px;">
                                                              <?php 
															  		echo $option_city;
															  ?>
                                                          </select>
                                            
                                                          <select id='id_des_region' class="option_search" name="id_des_region" style="width:120px">
                                                              <?php 
															  		echo $option_region;
															  ?>
                                                          </select>
                                                          
                                                          <div id="search_button_2" class="button1" style="display:none; width:65px; padding-left:5px; padding-right:5px; padding-top:5px; padding-bottom:5px;">Tìm kiếm</div>
                                                      </div>
                                                  </div>
                                                  <div class="base_color"><font size="+1"><b> Ngày nhận phòng: </b></font></div>
                                                      <input id="date" type="text" class="date_search" value='<?php echo $display_select_date; ?>' />
                                                      <input type='hidden' name='date' id='actualDate_tim' value='<?php echo $select_date; ?>' />
                                                      </form>
                                              </div>
                                              
											  <style>
                                                .ui-autocomplete-category 
                                                {
                                                    font-family: Verdana, Geneva, sans-serif;
                                                    font-weight: bold;
                                                    padding: .2em .4em;
                                                    color: #06F;
                                                    font-size: 14px;
                                                }
                                              </style>        
                                                 
                                              <script type="text/javascript">
                                                  jQuery.widget( "custom.catcomplete", jQuery.ui.autocomplete, {
                                                      _renderMenu: function( ul, items ) {
                                                          var that = this;
                                                              currentCategory = "";
                                                          jQuery.each( items, function( index, item ) {
                                                              if ( item.category != currentCategory ) {
                                                                  ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" );
                                                                  currentCategory = item.category;
                                                              }
                                                              that._renderItemData( ul, item );
                                                          });
                                                      }
                                                  });	
                                                                                            
                                                  jQuery(function()
                                                  {	  
                                                      jQuery( "#searchname" ).catcomplete(
                                                      {							  
                                                          source: function (request, response)
                                                          {
                                                              jQuery.ajax(
                                                              {
                                                                  url: "index.php/khachsan/LayThanhPho_TenKhachSan_ajax",
                                                                  type: 'POST',
                                                                  dataType: "json",
                                                                  data: 
                                                                  {
                                                                      style: "full",
                                                                      maxRows: 12,
                                                                      name_startsWith: request.term
                                                                  },					
                                                                  success: function(msg)
                                                                  {
                                                                      response(jQuery.map(msg, function(item)
                                                                      {
                                                                          return {label: item.label, category: item.category};
                                                                      }));
                                                                  }
                                                              });
                                                          },
                                                          minLength: 2
                                                      });
                                                      
                                                     jQuery( "#date" ).datepicker(
                                                     {
                                                          changeMonth: true,
                                                          changeYear: true,
                                                          altField: '#actualDate_tim',
                                                          altFormat: 'yy-mm-dd',
                                                          dateFormat: 'dd/mm/yy'
                                                      });	   							  
                                                  });
                                                  
                                                  function clearText(field)
                                                  {
													  
                                                      if (field.value == "Nhập tên thành phố hoặc tên khách sạn...") field.value = '';
                                                      else if (field.value == '') field.value = "Nhập tên thành phố hoặc tên khách sạn...";
                                                  }
                                                  
                                                  function displayButton(btn)
                                                  {
                                                      btn1 = document.getElementById("search_button_1");
                                                      btn2 = document.getElementById("search_button_2");
                                                      
                                                      if(btn == 1)
                                                      {
                                                          btn1.style.display = "inline";
                                                          btn2.style.display = "none";
                                                      }
                                                      else 
                                                      {	
                                                          btn2.style.display = "inline";
                                                          btn1.style.display = "none";
                                                          document.getElementById("searchname").value = "Nhập tên thành phố hoặc tên khách sạn...";
                                                      }
                                                  }
                                                  
                                                  jQuery("#id_des_country").change(function()
                                                  {
                                                      var form_data = 
                                                      {
                                                          choice: '1', 
                                                          quocgia:jQuery('#id_des_country').val()
                                                      };
                                                      jQuery.ajax(
                                                      {
                                                          url: "<?php echo site_url('searchKhachSan/getCityByCountry'); ?>",
                                                          type: "POST",
                                                          data: form_data,
                                                          dataType: 'html',
                                                          success: function(mgs)
                                                          {
                                                              jQuery('#destination_search').html(mgs);
                                                              jQuery('#qg').val(jQuery('#id_des_country').val());
                                                          }
                                                      });
                                                   });
                                                
                                                   jQuery("#id_des_city").change(function()
                                                   {				
                                                      var form_data = 
                                                      {
                                                          choice: '2',
                                                          quocgia:jQuery('#id_des_country').val(),
                                                          thanhpho:jQuery('#id_des_city').val()
                                                      };
                                                      jQuery.ajax(
                                                      {
                                                          url: "<?php echo site_url('searchKhachSan/getRegionByCity'); ?>",
                                                          type:"POST",
                                                          data: form_data,
                                                          dataType: 'html',
                                                          success: function(mgs)
                                                          {
                                                              jQuery('#destination_search').html(mgs);
                                                              jQuery('#tp').val(jQuery('#id_des_city').val());
		                                                      jQuery('#kv').val("");
                                                          }
                                                      });
                                                  });
                                                  
                                                  jQuery("#id_des_region").change(function()
                                                  {
                                                      jQuery('#kv').val(jQuery('#id_des_region').val());
                                                  });
                                                                                          
                                                  jQuery("#search_button_1").click(function()
                                                  {
                                                      if(jQuery('#searchname').val()=='Nhập tên thành phố hoặc tên khách sạn...')
                                                      {
                                                          alert("Xin vui lòng nhập tên khách sạn (hoặc thành phố)!");
                                                          return;
                                                      }
                                                      jQuery('#form_search_name').submit();
                                                  });
                                                  
                                                  jQuery("#search_button_2").click(function()
                                                  {
                                                      if(jQuery('#id_des_country').val()=="")
                                                      {
                                                          alert("Xin vui lòng lựa chọn các tiêu chí có sẵn!");
                                                          return;
                                                      }
                                                      if(jQuery('#id_des_city').val()=="")
                                                      {
                                                          alert("Xin vui lòng chọn thành phố!");
                                                          return;
                                                      }
                                                      jQuery('#form_search_name').submit();
                                                  });							
                                              </script>
                                            
                                        </div>

                                    </div><!--End moduleTable-->

                                </div><!--End Header_02-->
                                <!--<p>Khu vực đặt khung search</p>-->
                            </div>
                            <!--End Search Form-->
                        </div>
                    </div>
                    <!--end:header container -->
                </div>
            </div>
            <!--end:header -->
            <div class="clear">&nbsp;</div>
            <div class="container_16">
                <!--start:content container -->
                <div class="box-content" style="min-height:200px;">
                    <!--start:box-content -->
                    <!-- Danh sách khách sạn-->
                    <?php if ($DSKhachSan == NULL) { ?> <p><font color="#000000" size="+2">Không có khách sạn theo yêu cầu của bạn. Xin vui lòng chọn lại thông tin</font></p> 
                        <?php
                    } else {
                        foreach ($DSKhachSan as $row) {
                            ?>

                            <table width="900" bgcolor="#FFFFFF" style="margin-left:16px; margin-top:10px; text-align:center; border-bottom:1px solid #CCC;">
                                <tr>
                                    <td align="left" width="160">
                                        <div style="margin:0px 0px 10px 0px">
                                            <img src="<?php if ($row->Hinh != '') echo $row->Hinh; else echo 'resources/home/images/no_image.jpg' ?>"/>
                                        </div>
                                    </td>
                                    <td align="left" width="600" style="margin: 0px 10px 10px 15px">
                                        <div style="margin:0px 10px 10px 10px">
                                            <p><a style="text-decoration: none;" href="<?php echo site_url('datphong/khachsan/' . $row->MaKhachSan) ?>"><font color="#0080FF" size="+2"><b><?php echo $row->TenKhachSan; ?></b></font></a> <img src="<?php echo 'resources/home/images/template/star' . $row->TieuChuan . '.0.png'; ?>"/> </p>
                                            <p><font style="margin-bottom:20px" size="+1"><?php
                    							$diachi = $row->SoNha . ' ' . $row->Duong;
							                    if ($row->Quan != '')
							                        $diachi = $diachi . ', ' . $row->Quan;
							                    $diachi = $diachi . ', ' . $row->Tinh_ThanhPho . ', ' . $row->QuocGia;
							                    echo $diachi;
                            				?></font></p>
                                            <p><font color="#000000" size="+2"><?php echo substr($row->ThongTin, 0, 400) . '...'; ?></font></p>
                                        </div>
                                    </td>
                                    <td align="center" width="135" style="margin:0px 0px 10px 20px">
                                        <p><font style="margin-bottom:10px" color="#666666" size="+1">Giá từ: </font><font style="margin-bottom:10px" color="#0080FF" size="+3"><?php echo number_format($row->GiaTruocKhuyenMai * 1000,  0, ',', '.'); ?></font><font style="margin-bottom:10px" color="#666666" size="+1"> VND</font></p>
                                        <p><font style="margin-bottom:10px" color="#666666" size="+1">Đánh giá: </font><font style="margin-bottom:10px" color="#00DD37" size="+3"><b><?php echo $row->Diem ?></b></font></p>
                                        <p align="center"><a class="changedate" href="<?php echo site_url('datphong/khachsan/' . $row->MaKhachSan) ?>">Đặt phòng</a></p>
                                    </td>
                                </tr>
                                <tr><td colspan="3" height="10">&nbsp;</td></tr>
                            </table>

                        <?php }
                    }
                    ?>

                    <!--End DS khách sạn-->
                    <form id="myform" class="">
                        <input type="hidden" id="loaiphong"/>
                    </form>
                    <!--End DS khách sạn-->
                </div>
                <!--end:box-content -->

            </div>

            <!--end:content container -->
            <div class="clear"></div>
            <!-- End middle content -->
            <div class="footer">
                <!--start:footer -->
                <div class="container_16">
                    <!--start:footer container -->
                    <div class="footer_left">
                        <!--start:footer left part-->
                        <p> &copy; Copyright 2012 <a href="index.php/home" target="_blank">i12 Online Booking | N12~SuperStar</a></p>
                    </div>
                    <!--start:footer left part-->
                    <div class="footer_right">
                        <!--start:footer right part-->
                        <p>Designed and Developed by <a href="http://www.themeflash.com" target="_blank">Themeflash.com</a></p>
                    </div>
                    <!--end:footer right part-->
                </div>
                <!--end:footer container -->
            </div>
            <center>Design Downloaded from <a href="http://www.template4all.com/" title="free website templates" target="_blank">Free Website Templates</a> | <a href="http://www.freethemes4all.com/" title="free css templates" target="_blank">free css templates</a> | <a href="http://www.seodesign.us" title="free psd files" target="_blank">Free PSD Files</a></center>

            <!--end:footer -->
    </body>
</html>